#include "backGround.h"
#include "Resource.h"

backGround::backGround()
{
	Resource* r = 0;
	r = r->Instance();

	_bitmap = r->_backGround;

	p.setPoint(0, 0);
	nowdraw = 0;
}

void backGround::draw()
{
	al_draw_bitmap(_bitmap[nowdraw], p.x, p.y, 0);
}

void backGround::updata()
{
	p.y--;
	if (p.y < -220)
	{
		p.y = 0;
	}
}

void backGround::setNowDraw(int i)
{
	if (i < _bitmap.size())
	{
		nowdraw = i;
	}
	else
	{
		cout << "error" << endl;
	}
}